package cn.akwangl.common.uoload.aliyun.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = RAMProperties.RAM_PREFIX)
public class RAMProperties {
    public static final String RAM_PREFIX = "ram";

    private String endpoint = "sts.aliyuncs.com";
    private String accessKeyId = "LTAI4FrnLUrTQap9NFQLgFHw";
    private String accessKeySecret = "S4aalU8heFZ1d25bZ0pi8s0qVFzUDj";
    private String roleArn = "acs:ram::1116530586262325:role/oss-crud";
    private String roleSessionName = "oss-crud";
    private Long durationSeconds = 9000L;
    /**
     * 在扮演角色的时候额外添加的权限限制。
     */
    private String policy = "{\n" +
            "    \"Version\": \"1\", \n" +
            "    \"Statement\": [\n" +
            "        {\n" +
            "            \"Action\": [\n" +
            "                \"oss:*\"\n" +
            "            ], \n" +
            "            \"Resource\": [\n" +
            "                \"acs:oss:*:*:*\" \n" +
            "            ], \n" +
            "            \"Effect\": \"Allow\"\n" +
            "        }\n" +
            "    ]\n" +
            "}";
}
